package cn.tedu.store.temperatureDetection.service.impl;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.util.IdUtil;
import cn.tedu.store.temperatureDetection.entity.EmployeeTemperature;
import cn.tedu.store.temperatureDetection.entity.dto.EmployeeDto;
import cn.tedu.store.temperatureDetection.entity.dto.EmployeeTemperatureDto;
import cn.tedu.store.temperatureDetection.mapper.EmployeeTemperatureMapper;
import cn.tedu.store.temperatureDetection.service.EmployeeTemperatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 75936
 * @version 1.0
 * @project demo_hesuan
 * @description
 * @date 2022-11-28 19:27:43
 */
@Service
public class EmployeeTemperatureServiceImpl implements EmployeeTemperatureService {
    @Autowired
    private EmployeeTemperatureMapper employeeTemperatureMapper;

    @Override
    public void addEmployeeTemperature(EmployeeTemperature employeeTemperature) {

        employeeTemperature.setId(IdUtil.getSnowflakeNextId());
        employeeTemperature.setCreateTime(new DateTime());
        employeeTemperatureMapper.addEmployeeTemperature(employeeTemperature);
    }

    @Override
    public List<EmployeeTemperatureDto> findCount(String emplCode, String emplName) {
        List<EmployeeTemperatureDto> list = employeeTemperatureMapper.finfCount(emplCode,emplName);
        return  list;
    }

    @Override
    public List<EmployeeDto> findEmployee(String emplCode, String emplName) {
        return employeeTemperatureMapper.findEmployee(emplCode,emplName);
    }


}
